package com.woniu.humanresource.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.woniu.humanresource.entity.AttendanceStyle;


import java.util.ArrayList;
import java.util.List;

public class AttendanceStyleListener extends AnalysisEventListener<AttendanceStyle> {
    private static List<AttendanceStyle> attendanceStyleList = new ArrayList<>();


    @Override
    public void invoke(AttendanceStyle attendanceStyle, AnalysisContext analysisContext) {
        attendanceStyleList.add(attendanceStyle);
        System.out.println("解析到一条数据：" + attendanceStyle);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("全部解析完成");
    }
    //获取解析数据
    public static List<AttendanceStyle> getAttendanceStyleList() {
        return attendanceStyleList;
    }
}
